#include "structure.h"

void linknode(node* p_node) {
	p_node->link = (node*)malloc(sizeof(node));
	p_node->link->link = NULL;
	p_node->link->data = NULL;
}

void insertdata(node* p_node,char* data) {
	p_node->data = (char*)malloc(strlen(data));
	strcpy(p_node->data,data);
	free(data);
}

char* getdata() {
	char temp[512];
	char* data;
	fflush(stdin);
	gets(temp);
	
	data = (char*)malloc(strlen(temp)+1);
	strcpy(data,temp);
	
	return data;
}